Skip to main content

Get XMLNode Attributes

AutomatR.DeafultActivities.API.GetXMLNodeAttributes

The "Get XML Node Attributes" activity in AutomatR is designed to retrieve attributes from an XML node. This activity is useful for extracting specific attribute values or obtaining a dictionary of all attributes associated with an XML node within automation workflows.

Properties

NameDescription
Input
XML NodeSpecifies the XML node from which attributes are to be retrieved. This input is required for the activity to function correctly. Provide an XmlNode variable representing the XML node.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Get XML Node Attributes" activity. This optional delay can be used to manage synchronization or pacing issues. Integer variables containing the delay duration (e.g., 5 for 5 seconds).
AttributeSpecifies the name of the attribute within the XML node whose value is to be retrieved. This input is optional, and if provided, the activity will return the value of the specified attribute. Provide a string variable containing the attribute name.
Output
NodesOutputs a dictionary of all attributes associated with the XML node. The dictionary contains attribute names as keys and attribute values as values. Variables of type Dictionary<string, string> to store the attributes.
Attribute ValueOutputs the value of the specified attribute. If the "Attribute" input is provided, this output will contain the value of that specific attribute. Variables of type string to store the attribute value.

How to use:

  1. Drag and drop the "Get XML Node Attributes" activity onto the workflow.
  2. Configure the properties by specifying the XML node from which attributes are to be retrieved.
  3. Optionally, configure the delay, attribute name, or both based on your requirements.
  4. Execute the workflow to retrieve attributes from the specified XML node.

Example: Consider an example where the "Get XML Node Attributes" activity is used to obtain attributes from an XML node representing a book:

Get XML Node Attributes:
XML Node: bookNode
Attribute: author
Delay: 3
Attribute Value: authorAttributeValue

In this example, the activity retrieves the "author" attribute value from the specified XML node "bookNode" after a delay of 3 seconds. The attribute value is stored in the string variable authorAttributeValue for further use in the workflow.